import 'show_notices_filel.dart';

class QryNoticesLstEntity {
//ID，修改时必须传否则当做新增
  String id = "";
//标题
  String title = "";
//内容
  String info = "";
//类型【常规图文：NT_CAN_GUI、仅视频：NT_VIDEO、仅链接：NT_LINK】
  String type = "";
  //类型名称
  String typeName = "";
  //关联查
  //发布人昵称
  String createUserNickname = "";
  //关联查（需加字段）
  //发布人头像路径
  String createUserHeadImg = "";
  //无此字段，计算型属性
  //发布时间距现在时长，1分钟内、n分钟前、n小时前、n天前、n个月前、n年前
  String beforeNowTimeLong = "";
  //点赞数
  String fineCt = "0";
  //帖子相关的文件路径和类型
  List<ShowNoticesFilelEntity> lstNoticesFile = [];
  //当前登录人是否点赞")
  String currentUserLike = "N";
  bool isSelect = false;

  String createUserId;

  String createDate;

  QryNoticesLstEntity(
      {this.id,
      this.currentUserLike,
      this.title,
      this.info,
      this.type,
      this.typeName,
      this.createUserId,
      this.createUserNickname,
      this.createUserHeadImg,
      this.createDate,
      this.beforeNowTimeLong,
      this.fineCt,
      this.lstNoticesFile});

  QryNoticesLstEntity.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    currentUserLike = json['currentUserLike'];
    title = json['title'];
    info = json['info'];

    type = json['type'];
    typeName = json['typeName'];
    createUserId = json['createUserId'];
    createUserNickname = json['createUserNickname'];
    createUserHeadImg = json['createUserHeadImg'];
    createDate = json['createDate'];
    beforeNowTimeLong = json['beforeNowTimeLong'];
    fineCt = json['fineCt'];
    if (json['lstNoticesFile'] != null) {
      lstNoticesFile = new List<ShowNoticesFilelEntity>();
      json['lstNoticesFile'].forEach((v) {
        lstNoticesFile.add(new ShowNoticesFilelEntity.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['currentUserLike'] = this.currentUserLike;
    data['title'] = this.title;
    data['info'] = this.info;
    data['type'] = this.type;
    data['typeName'] = this.typeName;
    data['createUserId'] = this.createUserId;
    data['createUserNickname'] = this.createUserNickname;
    data['createUserHeadImg'] = this.createUserHeadImg;
    data['createDate'] = this.createDate;
    data['beforeNowTimeLong'] = this.beforeNowTimeLong;
    data['fineCt'] = this.fineCt;
    if (this.lstNoticesFile != null) {
      data['lstNoticesFile'] =
          this.lstNoticesFile.map((v) => v.toJson()).toList();
    }
    return data;
  }
}
